package com.factors.ZhangDingHou.Distance_from_Home;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class DistanceFromHomeCount implements Writable {
    private int count;

    public DistanceFromHomeCount() {}

    public DistanceFromHomeCount(int count) {
        this.count = count;
    }

    public void merge(DistanceFromHomeCount other) {
        this.count += other.getCount();
    }

    public int getCount() {
        return count;
    }

    @Override
    public void write(DataOutput out) throws IOException {
        out.writeInt(count);
    }

    @Override
    public void readFields(DataInput in) throws IOException {
        this.count = in.readInt();
    }
}